<?php 
 require_once 'ReplyAction.class.php';
 
$msg_id = isset($_POST['msg_id']) ? $_POST['msg_id'] : null;
$admin_id = isset($_POST['admin_id']) ? $_POST['admin_id'] : null;
$content = isset($_POST['content']) ? $_POST['content'] : null;
$method = isset($_POST['method']) ? $_POST['method'] : null;

$action = new ReplyAction();

if($method == 'add'){
	$reply = new Reply();
	$reply -> msg_id = $msg_id;
	$reply -> admin_id = $admin_id;
	$reply -> content = $content;
	if($reply -> id = $action -> add($reply)){
		$reply = $action -> queryById($reply);
		$data = array("id" => $reply -> id,
					"msg_id" => $reply -> msg_id,
					"admin_id" => $reply -> admin_id,
					"content" => $reply -> content,
					"create_time" => $reply -> create_time);
		echo json_encode($data);
	} else {
		echo false;
	}
	
}


 ?>